/*
 * Copyright (C) 2017, NVIDIA Corporation. All rights reserved.
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * may be copied, distributed, and modified under those terms.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 */

#ifndef __LOG_STATE_H
#define __LOG_STATE_H

#ifdef __ASSEMBLER__
#define ENUM_START
#define ENUM_VALUE(key, value) .equ key, value
#define ENUM_END(typename)
#else
#define ENUM_START typedef enum {
#define ENUM_VALUE(key, value) key = value,
#define ENUM_END(typename) } typename;
#endif

#define STATE_LOG_MASK	0x7FFFFFFF

ENUM_START

ENUM_VALUE(ADSP_LOADER_MAIN_ENTRY, 0x1)
ENUM_VALUE(ADSP_LOADER_MAIN_CACHE_DISABLE_COMPLETE, 0x2)
ENUM_VALUE(ADSP_LOADER_MAIN_CONFIGURE_MMU_COMPLETE, 0x3)
ENUM_VALUE(ADSP_LOADER_MAIN_CACHE_ENABLE_COMPLETE, 0x4)
ENUM_VALUE(ADSP_LOADER_MAIN_FPU_ENABLE_COMPLETE, 0x5)
ENUM_VALUE(ADSP_LOADER_MAIN_DECOMPRESSION_COMPLETE, 0x6)
ENUM_VALUE(ADSP_LOADER_MAIN_EXIT, 0x7)

ENUM_VALUE(ADSP_START_ENTRY_AT_RESET, 0x101)
ENUM_VALUE(ADSP_START_CPU_EARLY_INIT, 0x102)
ENUM_VALUE(ADSP_START_FIRST_BOOT, 0x103)
ENUM_VALUE(ADSP_START_LK_MAIN_ENTRY, 0x104)

ENUM_VALUE(ADSP_LK_MAIN_ENTRY, 0x201)
ENUM_VALUE(ADSP_LK_MAIN_EARLY_THREAD_INIT_COMPLETE, 0x202)
ENUM_VALUE(ADSP_LK_MAIN_EARLY_ARCH_INIT_COMPLETE, 0x203)
ENUM_VALUE(ADSP_LK_MAIN_EARLY_PLATFORM_INIT_COMPLETE, 0x204)
ENUM_VALUE(ADSP_LK_MAIN_EARLY_TARGET_INIT_COMPLETE, 0x205)
ENUM_VALUE(ADSP_LK_MAIN_CONSTRUCTOR_INIT_COMPLETE, 0x206)
ENUM_VALUE(ADSP_LK_MAIN_HEAP_INIT_COMPLETE, 0x207)
ENUM_VALUE(ADSP_LK_MAIN_KERNEL_INIT_COMPLETE, 0x208)
ENUM_VALUE(ADSP_LK_MAIN_CPU_RESUME_ENTRY, 0x209)

ENUM_VALUE(ADSP_BOOTSTRAP2_ARCH_INIT_COMPLETE, 0x301)
ENUM_VALUE(ADSP_BOOTSTRAP2_PLATFORM_INIT_COMPLETE, 0x302)
ENUM_VALUE(ADSP_BOOTSTRAP2_TARGET_INIT_COMPLETE, 0x303)
ENUM_VALUE(ADSP_BOOTSTRAP2_APP_MODULE_INIT_COMPLETE, 0x304)
ENUM_VALUE(ADSP_BOOTSTRAP2_APP_INIT_COMPLETE, 0x305)
ENUM_VALUE(ADSP_BOOTSTRAP2_STATIC_APP_INIT_COMPLETE, 0x306)
ENUM_VALUE(ADSP_BOOTSTRAP2_OS_LOAD_COMPLETE, 0x307)

ENUM_VALUE(ADSP_SUSPEND_BEGINS, 0x320)
ENUM_VALUE(ADSP_SUSPEND_MBX_SEND_COMPLETE, 0x321)
ENUM_VALUE(ADSP_SUSPEND_DISABLED_TIMERS, 0x322)
ENUM_VALUE(ADSP_SUSPEND_DISABLED_INTS, 0x323)
ENUM_VALUE(ADSP_SUSPEND_ARAM_SAVED, 0x324)
ENUM_VALUE(ADSP_SUSPEND_AMC_SAVED, 0x325)
ENUM_VALUE(ADSP_SUSPEND_AMISC_SAVED, 0x326)
ENUM_VALUE(ADSP_SUSPEND_L1_CACHE_DISABLED, 0x327)
ENUM_VALUE(ADSP_SUSPEND_L2_CACHE_DISABLED, 0x328)
ENUM_VALUE(ADSP_RESUME_ADSP, 0x330)
ENUM_VALUE(ADSP_RESUME_AMISC_RESTORED, 0x331)
ENUM_VALUE(ADSP_RESUME_AMC_RESTORED, 0x332)
ENUM_VALUE(ADSP_RESUME_ARAM_RESTORED, 0x333)
ENUM_VALUE(ADSP_RESUME_COMPLETE, 0x334)
ENUM_VALUE(ADSP_WFI_ENTER, 0x335)
ENUM_VALUE(ADSP_WFI_EXIT, 0x336)
ENUM_VALUE(ADSP_DFS_MBOX_RECV, 0x337)
ENUM_VALUE(ADSP_DFS_MBOX_SENT, 0x338)

ENUM_END(adsp_state)

#endif
